import re

w = open('p1_trigs.txt', 'r')

t = w.read()

w.close()

GET_P = re.compile(r'P1(?!=[0-9]| )')

GET_PLAYER = re.compile(r'Player 1(?=")')

def general_macro(player):
    new_str = t
    new_str = GET_P.sub("P" + str(player), new_str)
    new_str = GET_PLAYER.sub("Player " + str(player), new_str)
    return new_str
